

var mongoose = require("mongoose");
var Schema = mongoose.Schema;

var usersSchema = new Schema({
    username:String,
    mobile:Number,
    password:String,
    address:String,
    nickname:String,
    time:Date
})

exports.Users = mongoose.model("myusers1",usersSchema);



var mvSchema = new Schema( {
    "genres": Array,
    "casts":Array,
    "directors": Array,
    "rating": Object,
    "title":String,
    "collect_count": Number,
    "original_title": String,
    "subtype": String,
    "year": String,
    "images": Object,
    "alt": String,
    "id": String
})

exports.Mv = mongoose.model("movie1",mvSchema);


var commentSchema = new Schema({
    cid:Number, // 自增长的id  _id
    title:String,
    content:String,
    time:Date,
    username:String,
    movie:Object  // 当前这条评论的电影数据信息 
})

exports.Comment = mongoose.model("comment1",commentSchema);


// 务必插入数据
var uidsSchema = new Schema({
    tablename:String,
    id:Number
})

exports.Uid = mongoose.model("uid1",uidsSchema);


// 学生教师表  
var accountSchema = new Schema({
    mobile:Number,
    username:String,
    pass:String,
    rolltype:String,  // 角色  1 学生 2讲师
    avatar:String,
    nikename:String,
    email:String,
    time:Date
})

exports.Account = mongoose.model("account1",accountSchema);


// 校区表  
var schoolSchema = new Schema({
    schname:String,
    schid:String,
})

exports.School = mongoose.model("school1",schoolSchema);

// 校区表  
var xuekeSchema = new Schema({
    xkname:String,
    xkid:String,
})

exports.Xueke = mongoose.model("xueke1",xuekeSchema);


// 校区班级表
var banjiSchema = new Schema({
    bjname:String,
    bjid:String,
    sch:String,
    xk:String,
    num:Number,
})

exports.Banji = mongoose.model("banji1",banjiSchema);